using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;

namespace CentralOffice.WebClient.Admin
{
    /// <summary>
    /// Summary description for $codebehindclassname$
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class AdminHandler : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");
            if (context.Request.QueryString.Count > 0)
            {
                if (context.Request.QueryString["operation"] == "checkuser")
                {
                    //string deptId = context.Request.QueryString["deptid"];
                    //DepartmentRow dept = CentralOffice.Admin.BusinessActions.Department.GetByIdFromCache(new Guid(deptId));

                    //dept.Delete();

                    //DepartmentManager.Update(dept.Table.DataSet);
                }

                if (context.Request.QueryString["operation"] == "checkuser")
                {
                    //string deptId = context.Request.QueryString["deptid"];
                    //DepartmentRow dept = CentralOffice.Admin.BusinessActions.Department.GetByIdFromCache(new Guid(deptId));

                    //dept.Delete();

                    //DepartmentManager.Update(dept.Table.DataSet);
                }

                if (context.Request.QueryString["operation"] == "checkuser")
                {
                    //string deptId = context.Request.QueryString["deptid"];
                    //DepartmentRow dept = CentralOffice.Admin.BusinessActions.Department.GetByIdFromCache(new Guid(deptId));

                    //dept.Delete();

                    //DepartmentManager.Update(dept.Table.DataSet);
                }

            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
